import tushare as ts,pandas as pd
token = 'd67b0d40ccabf543ac962d2987d124588ae6fa5d2041e70fc8c93beb'
api = ts.pro_api(token)
def getStockTradingDays(*symbol,startDate,endDate):
    tradedays=[]
    for stock_code in symbol:
        tradedays.append(api.daily(ts_code=stock_code,start_date=startDate,end_date=endDate))
    return pd.concat(tradedays)
result=getStockTradingDays('000001.SZ','600000.SH','300003.SZ',startDate='20211201',endDate='20211231')
print(result)
'''请编程验证，以下哪些代码替代上面这句代码不会出错，会出错的请用注释解释说明原因
#tradedays.append(api.daily(ts_code=stock_code,start_date=stratDate,end_date=endDate)) 

#tradedays.add(api.daily(ts_code=stock_code,start_date=stratDate,end_date=endDate))
tradedays是一个列表对象，而add()方法是set对象的方法，不能直接应用于列表。
  
#tradedays +=api.daily(ts_code=stock_code,start_date=stratDate,end_date=endDate)
#tradedays +=(api.daily(ts_code=stock_code,start_date=stratDate,end_date=endDate))
#tradedays +=(api.daily(ts_code=stock_code,start_date=stratDate,end_date=endDate),) 
#tradedays =tradedays[:]+(api.daily(ts_code=stock_code,start_date=stratDate,end_date=endDate),)
#tradedays =tuple(tradedays)+(api.daily(ts_code=stock_code,start_date=stratDate,end_date=endDate),)'''

